package com.deep.deepenterpise.model.entity;

import com.deep.deepenterpise.common.enums.DrStateEnum;
import com.deep.deepenterpise.model.to.unit.DrItemTo;
import com.deep.deepenterpise.model.vo.unit.DrDangerItemVo;
import com.deep.deepenterpise.model.vo.unit.DrUnitCheckItemVo;
import lombok.Data;

import java.io.Serializable;

/**
 * DR隐患关联表
 *
 * @TableName dr_danger_history_item
 */
@Data
public class DrDangerHistoryItem implements Serializable {
    /**
     *
     */
    private Integer drId;

    /**
     * 隐患子单号
     */
    private String drDangerSlaveNum;

    /**
     * 隐患项
     */
    private String drDangerItem;

    /**
     * 隐患等级
     */
    private Integer drType;

    private Integer drStatus;

    /**
     * 创建时间
     */
    private Long drCreateTime;

    private static final long serialVersionUID = 1L;

    public DrDangerHistoryItem() {
    }

    public DrDangerHistoryItem(String drDangerSlaveNum, DrDangerItemVo drDangerItemVo, Long drCreateTime) {
        this.drDangerSlaveNum = drDangerSlaveNum;
        this.drDangerItem = drDangerItemVo.getDrDangerItem();
        this.drType = drDangerItemVo.getDrType();
        this.drStatus = drDangerItemVo.getDrStatus();
        this.drCreateTime = drCreateTime;
    }

    public DrDangerHistoryItem(String drDangerSlaveNum, DrItemTo drItemTo, Long drCreateTime) {
        this.drDangerSlaveNum = drDangerSlaveNum;
        this.drDangerItem = drItemTo.getDrItem();
        this.drType = drItemTo.getDrType();
        this.drStatus = DrStateEnum.YES.getDrState();
        this.drCreateTime = drCreateTime;
    }

    public DrDangerHistoryItem(String drDangerSlaveNum, DrUnitCheckItemVo drUnitCheckItemVo, Long drCreateTime) {
        this.drDangerSlaveNum = drDangerSlaveNum;
        this.drDangerItem = drUnitCheckItemVo.getDrContent();
        this.drType = drUnitCheckItemVo.getDrIsDangers();
        this.drCreateTime = drCreateTime;
        this.drStatus = DrStateEnum.NO.getDrState();
    }
}